import request from '@/utils/request'

/**
 * 已添加的部门列表
 * @param {*} data
 */
export function queryList(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: 'backend/userAuthManagement/queryPageAboutDepts',
    method: 'post',
    data
  })
}

/**
 * 给人员添加部门
 * @param {*} data
 */
export function insert(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: 'backend/userAuthManagement/assignDeptPermissions',
    method: 'post',
    data
  })
}

/**
 * 删除可管理的部门
 * @param {*} query
 */
export function delDepartment(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/userAuthManagement/deleteByUserIdAndDeptIds',
    method: 'post',
    data
  })
}
